package com.ip.getip.entity;

import java.io.Serializable;
import java.util.List;

public class MailEntity implements Serializable{
    private String sender; //发件人
    private String senderName;//发件人昵称
    private List<String> addressees; //收件人
    private String makeACopyFor; //抄送
    private String bcc;//密送
    private String emailSubject;//邮件主题
    private String content;//邮件正文
    private String charset;//编码格式
    private String senderPass;//发件人密码或者授权码
    private String smtp;//邮箱服务器地址
    private final String smtpPort="465";//服务器端口

    public String getSender() {
        return sender;
    }

    public void setSender(String sender) {
        this.sender = sender;
    }

    public List<String> getAddressees() {
        return addressees;
    }

    public void setAddressees(List<String> addressees) {
        this.addressees = addressees;
    }

    public String getSenderName() {
        return senderName;
    }

    public void setSenderName(String senderName) {
        this.senderName = senderName;
    }

    public String getCharset() {
        return charset;
    }

    public void setCharset(String charset) {
        this.charset = charset;
    }

    public String getMakeACopyFor() {
        return makeACopyFor;
    }

    public void setMakeACopyFor(String makeACopyFor) {
        this.makeACopyFor = makeACopyFor;
    }

    public String getBcc() {
        return bcc;
    }

    public void setBcc(String bcc) {
        this.bcc = bcc;
    }

    public String getEmailSubject() {
        return emailSubject;
    }

    public void setEmailSubject(String emailSubject) {
        this.emailSubject = emailSubject;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getSenderPass() {
        return senderPass;
    }

    public void setSenderPass(String senderPass) {
        this.senderPass = senderPass;
    }

    public String getSmtp() {
        if (sender!=null){
            String[] split = sender.split("@");
            return "smtp."+split[1];
        }else {
            return "";
        }
    }

    public String getSmtpPort() {
        return smtpPort;
    }

    @Override
    public String toString() {
        return "MailEntity{" +
                "sender='" + sender + '\'' +
                ", senderName='" + senderName + '\'' +
                ", addressees=" + addressees +
                ", makeACopyFor='" + makeACopyFor + '\'' +
                ", bcc='" + bcc + '\'' +
                ", emailSubject='" + emailSubject + '\'' +
                ", content='" + content + '\'' +
                ", charset='" + charset + '\'' +
                ", senderPass='" + senderPass + '\'' +
                ", smtp='" + smtp + '\'' +
                ", smtpPort='" + smtpPort + '\'' +
                '}';
    }
}
